Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Creating a Single Tween Container

To create a single tween container, do the following:

  1. Create a QT atom container.
  2. Insert a kTweenEntry atom into the QT atom container for the tween. A kTweenEntry atom contains the atoms that define the tween.
  3. Insert a kTweenType atom that specifies the tween type into the kTweenEntry atom.
  4. Insert a kTweenData atom that contains the data for the tween into the kTweenEntry atom .

Listing 6 shows how to create a single kTweenTypeLong tween container that a component could use to interpolate two long integers.

Listing 6 Creating a single kTweenTypeLong tween container

QTAtomContainer container = nil;
long tweenDataLong[2];
QTAtomType tweenType;
QTAtom tweenAtom;

tweenDataLong[0] = EndianU32_NtoB(512);
tweenDataLong[1] = EndianU32_NtoB(0);

// create a new atom container
QTNewAtomContainer (&container);
// create the parent tween entry atom
tweenType = kTweenTypeLong;
QTInsertChild (container, kParentAtomIsContainer, kTweenEntry, 1, 0, 0,
                nil, &tweenAtom);
// add two child atoms to the tween entry atom --
// * the type atom, kTweenType
QTInsertChild (container, tweenAtom, kTweenType, 1, 0,
                sizeof(tweenType), &tweenType, nil);
// * the data atom, kTweenData
QTInsertChild (container, tweenAtom, kTweenData, 1, 0,
                sizeof(long) * 2, tweenDataLong, nil);

© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |